import { App } from "vue";
import "vant/lib/index.css";
import {
    Button,
    List,
    PullRefresh,
    Tabbar,
    TabbarItem,
    Swipe,
    SwipeItem,
    Image as VanImage,
    Form,
    Field,
    NavBar,
    Icon,
    Cell,
    CellGroup,
    Grid,
    GridItem,
    Col,
    Row,
    Skeleton,
    Divider,
    AddressList,
    AddressEdit,
    Toast,
    Tab,
    Tabs,
    Card,
    TreeSelect, Sidebar,Stepper , SidebarItem, ActionBar, ActionBarIcon, ActionBarButton, SwipeCell, Checkbox, CheckboxGroup,SubmitBar,Popup
} from "vant";

// https://vant-contrib.gitee.io/vant/v3/#/zh-CN
const plugins = [
    TreeSelect, Sidebar,Stepper , SidebarItem, ActionBar, ActionBarIcon, ActionBarButton, SwipeCell, Checkbox, CheckboxGroup,SubmitBar,Popup,
    Toast, Card,
    AddressList,
    AddressEdit,
    Divider,
    Skeleton,
    Button,
    List,
    Col,
    Row,
    Tabbar,
    TabbarItem,
    Swipe,
    SwipeItem,
    VanImage,
    PullRefresh,
    Form,
    Field,
    NavBar,
    Icon,
    Cell,
    CellGroup,
    Grid,
    GridItem,
    Tab,
    Tabs,
];

export default {
    install: function (vm: App) {
        plugins.forEach((item) => {
            vm.component(item.name, item);
        });
    },
};
